package ch6;

import java.io.*;
import java.util.Properties;

public class DataInAndout {
	public static void main(String[] args) throws IOException {

		DataOutputStream dout = new DataOutputStream(new FileOutputStream("e:/java61/test.txt"));
		dout.writeInt(10000);
		dout.writeChar(21016);
		dout.writeBoolean(2 > 1);
		dout.writeBoolean(2 < 1);
		dout.writeDouble(Math.PI);
		dout.writeLong(10000000000L);
		dout.writeUTF("汪翔");
		dout.close();
		DataInputStream din = new DataInputStream(new FileInputStream("e:/java61/test.txt"));
		System.out.println(din.readInt());
		System.out.println(din.readChar());
		System.out.println(din.readBoolean());
		System.out.println(din.readBoolean());
		System.out.println(din.readDouble());
		System.out.println(din.readLong());
		System.out.println(din.readUTF());
		din.close();
	}

}
